package com.tqw.client.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tqw.client.pojo.ClientPassword;
import com.tqw.pojo.Client;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author Will
 */
@Mapper
public interface ClientMapper extends BaseMapper<Client> {

    /**
     * 查询密码 通过 id
     * @param id
     * @return
     */
    @Select("select password from client where id=#{id}")
    String findPassword(Integer id);

    /**
     * 修改密码
     * @param newEncodePassword
     * @param id
     */
    @Update("update client set password=#{newEncodePassword} where id = #{id}")
    void updatePassword(String newEncodePassword,Integer id);

    /**
     * 更新头像
     * @param urlPath
     * @param id
     */
    @Update("update client set avatar=#{urlPath} where id = #{id}")
    void updateAvatar(String urlPath, Integer id);
}
